package com.volcreate.week2_3.no2;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @author zxc
 * @date 2020/9/21
 */

class Rectangle {
    private int width;
    private int length;

    public Rectangle(int width, int length) {
        this.length = length;
        this.width = width;
    }

    public int getPerimeter() {
        return (length + width) * 2;
    }

    public int getArea() {
        return length * width;
    }

    @Override
    public String toString() {
        return "Rectangle " +
                "[width=" + width +
                ", length=" + length +
                "]";
    }

}

class Circle {
    private int radius;

    public Circle(int radius) {
        this.radius = radius;
    }

    public int getPerimeter() {
        return (int) (Math.PI * 2 * radius);
    }

    public int getArea() {
        return (int) (Math.PI * radius * radius);
    }

    public String toString() {
        return "Circle [" +
                "radius=" + radius +
                ']';
    }
}

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        Rectangle[] rectangle = new Rectangle[2];
        rectangle[0] = new Rectangle(scanner.nextInt(), scanner.nextInt());
        rectangle[1] = new Rectangle(scanner.nextInt(), scanner.nextInt());

        Circle[] circle = new Circle[2];
        circle[0] = new Circle(scanner.nextInt());
        circle[1] = new Circle(scanner.nextInt());

        System.out.println(rectangle[0].getPerimeter() + rectangle[1].getPerimeter() + circle[0].getPerimeter() + circle[1].getPerimeter());
        System.out.println(rectangle[0].getArea() + rectangle[1].getArea() + circle[0].getArea() + circle[1].getArea());

        System.out.println(Arrays.deepToString(rectangle));
        System.out.println(Arrays.deepToString(circle));
    }
}


